<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>{$title} - <tp:sitename /></title>
    <meta name="keywords" content="{$keywords}" />
    <meta name="description" content="{$description}" />
    <link rel="shortcut icon" href="__PUBLIC__/images/favicon.ico" type="image/x-icon" /> 
    <link rel="stylesheet" href="__PUBLIC__/css/style_version1.css" type="text/css" />
    <link href="__PUBLIC__/css/member.css" rel="stylesheet" type="text/css" />
    <script src="__PUBLIC__/js/jquery.js" type="text/javascript"></script>
</head> 
<body> 

<include file="Public:header" />

<div class="container clearfix">
    
    <include file="Member:left" />
    
    <div class="member_main">
        <div class="perInfo">
            <div class="titleInfoBorder">
                <span>我的设置</span>
            </div>
            <div class="firstTabBox lineSpace">
                <a class="tab currentTab" href="{:U('Member/person')}">个人资料</a>
                <span class="line">|</span>
                <a class="tab" href="{:U('Member/avatar')}">头像设置</a>
                <span class="line">|</span>
                <a class="tab" href="{:U('Member/email')}">邮箱验证</a>
                <span class="line">|</span>
                <a class="tab" href="{:U('Member/password')}">修改密码</a>
            </div>
        </div>
        <div class="setting-right-wrap wrap-boxes settings">
            <div id="setting-profile" class="setting-wrap setting-profile">
                <div class="wlfg-wrap">
                    <label class="label-name" for="nick">昵称</label>
                    <input id="nickname" class="rlf-input rlf-input-nick" type="text" placeholder="请输入昵称." data-validate="nick" autocomplete="off" name="nickname" value="{$detail.nickname}" />
                </div>
                <div class="wlfg-wrap">
                    <label class="label-name" for="job">职位</label>
                    <select id="job" class="rlf-select" hidefocus="true" name="job" autocomplete="off">
                        <option value="">请选择职位</option>
                        <option value="页面重构设计">页面重构设计</option>
                        <option value="交互设计师">交互设计师</option>
                        <option value="产品经理">产品经理</option>
                        <option value="UI设计师">UI设计师</option>
                        <option value="JS工程师">JS工程师</option>
                        <option value="Web前端工程师">Web前端工程师</option>
                        <option value="移动开发工程师">移动开发工程师</option>
                        <option value="PHP开发工程师">PHP开发工程师</option>
                        <option value="软件测试工程师">软件测试工程师</option>
                        <option value="Linux系统工程师">Linux系统工程师</option>
                        <option value="JAVA开发工程师">JAVA开发工程师</option>
                        <option value="技术总监">技术总监</option>
                        <option value="CEO">CEO</option>
                        <option value="学生">学生</option>
                        <option value="其它">其它</option>
                    </select>
                </div>
                <div class="wlfg-wrap">
                    <label class="label-name" for="province-select">城市</label>
                    <span id="city_area">
                        <select class="prov"></select> 
                        <select class="city" disabled="disabled"></select>
                        <select class="dist" disabled="disabled"></select>
                    </span>
                </div>
                <div class="wlfg-wrap">
                    <label class="label">性别</label>
                    <label><input type="radio" name="sex" value="0" hidefocus="true" autocomplete="off" <if condition="!$detail.sex">checked="checked"</if> >保密</label>
                    <label><input type="radio" name="sex" value="1" hidefocus="true" autocomplete="off" <if condition="$detail.sex eq 1">checked="checked"</if> > 男</label>
                    <label><input type="radio" name="sex" value="2" hidefocus="true" autocomplete="off" <if condition="$detail.sex eq 2">checked="checked"</if>> 女</label>

                </div>
                
                <div class="wlfg-wrap">
                    <label class="label-name" for="nick">手机</label>
                    <input id="mobile" class="rlf-input" type="text" placeholder="请输入手机号码." data-validate="mobile" autocomplete="off" name="mobile" value="{$detail.mobile}" />
                </div>
                <div class="wlfg-wrap">
                    <label class="label-name" for="nick">QQ</label>
                    <input id="qq" class="rlf-input" type="text" placeholder="请输入qq." data-validate="qq" autocomplete="off" name="qq" value="{$detail.qq}" />
                </div>
                
                <div class="wlfg-wrap">
                    <label class="label-name label_signature" for="aboutme">个性签名</label>
                    <textarea class="textarea textarea_signature" rows="5" cols="30" id="signature">{$detail.signature|default='这位童鞋很懒，什么也没有留下～～！'}</textarea>

                </div>
                <div class="wlfg-wrap">
                    <label class="label-name"></label>
                    <input type="hidden" name="type" id="type" value="{$detail.type}" />
                    <button class="btn" type="button" id="btn_submit">保存</button>
                </div>
            </div>
        </div>
        <div class="pager"></div>
    </div>
    
</div>

<include file="Public:footext" />
<include file="Member:mfooter" />
<script type="text/javascript" src="__PUBLIC__/js/other/jquery.cityselect.js"></script>
<script type="text/javascript">
    $(function() {
        $("#city_area").citySelect({
            prov: "",
            city: "",
            dist: "",
            nodata: "none",
            url: "__PUBLIC__/js/other/city.min.js"
        });
        $("#btn_submit").click(function() {
            var nickname = $("#nickname").val();
            var job = $("#job").val();
            var sex = $("input[name=sex]:checked").val();
			var mobile = $("#mobile").val();
			var qq = $("#qq").val();
            var signature = $("#signature").val();
            var area = '';
			var type = $("#type").val();
            $("#city_area").children("select").each(function() {
                area += $(this).val() + ",";
            })
            checkBefore('#btn_submit');
            $.post(getUrl("Ajax-updateInfo"), {nickname: nickname, job: job, address: area, sex: sex, signature: signature, mobile: mobile, qq: qq, type: type}, function(data) {
																																							  				if(data == '1'){
					$("#signed_textarea").val(signature);
					$(".job-title").html(job);
					$(".myname").html(nickname);
					checkAfter('#btn_submit');
					showSuccessTip('资料修改成功！');
				}else{
					showLoginError('资料修改失败！');
				}
            }, "json")
        })
    })

</script>
</body>
</html>
